"use strict";
cc._RF.push(module, '76fbeRqsuZHYp7lKYCTSk1b', 'ParseCSV');
// scripts/engines/libs/ParseCSV.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ParseCSV = /** @class */ (function () {
    function ParseCSV() {
    }
    ParseCSV.csvToArray = function (strData, strDelimiter) {
        strDelimiter = (strDelimiter || ",");
        var objPattern = new RegExp(("(\\" + strDelimiter + "|\\r?\\n|\\r|^)" +
            "(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|" +
            "([^\"\\" + strDelimiter + "\\r\\n]*))"), "gi");
        var arrData = [[]];
        var arrMatches = null;
        while (arrMatches = objPattern.exec(strData)) {
            var strMatchedDelimiter = arrMatches[1];
            if (strMatchedDelimiter.length && (strMatchedDelimiter != strDelimiter)) {
                arrData.push([]);
            }
            if (arrMatches[2]) {
                var strMatchedValue = arrMatches[2].replace(new RegExp("\"\"", "g"), "\"");
            }
            else {
                var strMatchedValue = arrMatches[3];
            }
            arrData[arrData.length - 1].push(strMatchedValue);
        }
        if (arrData.length > 0) {
            var popData = arrData[arrData.length - 1];
            if (popData && popData.length <= 1) {
                if (popData[0] == null || popData[0] == '' || popData[0].trim() == '') {
                    arrData.pop();
                }
            }
        }
        return arrData;
    };
    return ParseCSV;
}());
exports.default = ParseCSV;

cc._RF.pop();